Current Location: Home> Function Categories> log1p

log1p

Returns log(1 + number), and can calculate the exact result even when the value of number is close to zero.
Name:log1p
Category:math
Programming Language:php
One-line Description:Returns log(1+number).

Definition and usage

log1p() returns log(1+ number ) , and the accurate result can be calculated even when the value of number is close to zero.

Example

Returns the log(1+ number ) of different values. Calculation result:

 <?php
echo ( log1p ( 2.7183 ) ) ;
echo ( log1p ( 2 ) ) ;
echo ( log1p ( 1 ) ) ;
echo ( log1p ( 0 ) ) ;
?>

Try it yourself

grammar

 log1p ( x )
parameter describe
x Required. A number.

illustrate

Warning: This function is experimental. The behavior of this function, including function name and any other documentation about this function, may change with subsequent releases by PHP without notification. Use of this function at your own risk.

Similar Functions
Popular Articles